<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>apis</title>
</head>
<body>
  
</body>
<script>
  var names = Object.getOwnPropertyNames(window);
  /* js标准规定的属性*/
  let jsObjects = ["BigInt", "BigInt64Array", "BigUint64Array", "Infinity", "NaN", "undefined",
   "eval", "isFinite", "isNaN", "parseFloat", "parseInt", "decodeURI", "decodeURIComponent",
    "encodeURI", "encodeURIComponent", "Array", "Date", "RegExp", "Promise", "Proxy", "Map",
     "WeakMap", "Set", "WeakSet", "Function", "Boolean", "String", "Number", "Symbol", "Object",
      "Error", "EvalError", "RangeError", "ReferenceError", "SyntaxError", "TypeError", "URIError", 
      "ArrayBuffer", "SharedArrayBuffer", "DataView", "Float32Array", "Float64Array", "Int8Array", 
      "Int16Array", "Int32Array", "Uint8Array", "Uint16Array", "Uint32Array", "Uint8ClampedArray", 
      "Atomics", "JSON", "Math", "Reflect", "escape", "unescape"]
  names = names.filter(item => jsObjects.indexOf(item) < 0);
  let nodeSet = new Set();
  names.forEach(item => {
    if(window[item] && window[item].prototype instanceof Node) nodeSet.add(item)
  })
  /* DOM api*/ 
  nodeSet.add('Node')
  names = names.filter(item => !nodeSet.has(item))
  /* window对象上的属性*/
  let windowObjects = ["window", "self", "document", "name", "location", "history", "customElements", "locationbar", "menubar", " personalbar", "scrollbars", "statusbar", "toolbar", "status", "close", "closed", "stop", "focus", " blur", "frames", "length", "top", "opener", "parent", "frameElement", "open", "navigator", "applicationCache", "alert", "confirm", "prompt", "print", "postMessage", "console"];
  names = names.filter(item => windowObjects.indexOf(item) < 0);
  /* 事件api*/
  names = names.filter(item => !item.match(/^on/))
  /* webkit私有api*/
  names = names.filter(item => !item.match(/^webkit/))
  /* stream api*/
  let streamObjects = ["ReadableStream", "ReadableStreamDefaultReader", "ReadableStreamBYOBReader", "ReadableStreamDefaultController", "ReadableByteStreamController", "ReadableStreamBYOBRequest", "WritableStream", "WritableStreamDefaultWriter", "WritableStreamDefaultController", "TransformStream", "TransformStreamDefaultController", "ByteLengthQueuingStrategy", "CountQueuingStrategy"]
  /* webGL api*/
  let webGLObjects = ["WebGLContextEvent","WebGLObject", "WebGLBuffer", "WebGLFramebuffer", "WebGLProgram", "WebGLRenderbuffer", "WebGLShader", "WebGLTexture", "WebGLUniformLocation", "WebGLActiveInfo", "WebGLShaderPrecisionFormat", "WebGLRenderingContext"]
  /* */
  console.log(names)
</script>
</html>
